"""
@title(TenX腾晓2024年11月考核答题文件)
@warning(请勿修改参数和返回值)
@warning(请认真填写__init__中的数据)
@author(1323230180)
"""
from typing import List, Tuple


class TenXClass:
    def __init__(self):
        self.name = "万家骏"
        self.id = "3124002019"

    @staticmethod
    def question1(n: int) -> list[str]:
        a = "";
        l = []
        for i in range(1, 1 + n):
            while i > 3:
                a = str(i % 4) + a;
                i //= 4
            a = str(i) + a;
            l.append(a);
            a = ""
        return l

    @staticmethod
    def question2() -> list[tuple[int, int, int]]:
        l = []
        for x in range(0, 20):
            y = int(25 - 1.75 * x);
            z = int(75 + 0.75 * x)
            if x + y + z == 100 and y * z >= 0: l.append((x, y, z))
        return l

    @staticmethod
    def question3(equipment: list[str], prop: list[str], material: list[str], items: list[str]) -> dict[str, list[str]]:
        e, m, p = [], [], []
        for a in items:
            if a in equipment:
                e.append(a)
            elif a in prop:
                p.append(a)
            else:
                m.append(a)
        return {"equipment": e, "prop": p, "material": m}

    @staticmethod
    def question4(item_values: dict[str, int], items: list[str]) -> tuple[list[str], int]:
        b = [];
        v = 0
        for i in items:
            b.append(item_values[i])
        r = [i for _, i in sorted(zip(b, items))][::-1][0:3]
        for j in r:
            v += item_values[j]
        return r, v

    @staticmethod
    def question5(matrix: list[list[int]]) -> list[tuple[int, int]]:
        l = [];
        h = len(matrix);
        w = len(matrix[0])
        for n in range(h):
            for m in range(w):
                if matrix[n][m] == 0: l.append((n + 1, m + 1))
        return l
